<template>
  <el-menu
    default-active="2"
    class="el-menu-vertical-demo"
    @open="handleOpen"
    @close="handleClose"
    @select="InsertStore"
    background-color="#545c64"
    text-color="#fff"
    active-text-color="#ffd04b">
    <el-submenu index="1">
      <template slot="title">
        <span>培训计划管理</span>
      </template>
        <el-menu-item index="所有培训计划,TrainPlanManage">所有培训计划</el-menu-item>
        <el-menu-item index="计划制定,TrainPlanAdd"  >计划制定</el-menu-item>
    </el-submenu>
    <el-submenu index="5">
      <template slot="title">
        <span>培训课程管理</span>
      </template>
      <el-menu-item index="所有课程,CourseCheckAndUpdate">所有课程</el-menu-item>
      <el-menu-item index="上传课程,AddTrainCourse">上传课程</el-menu-item>
      <el-menu-item index="课程评论管理,TrainCourseTalkManage">课程评论管理</el-menu-item>
    </el-submenu>
    <el-submenu index="2">
      <template slot="title">
        <span>培训员工管理</span>
      </template>
      <el-menu-item index="所有员工,EmpTrainManage">所有员工</el-menu-item>
      <el-menu-item index="员工培训账号生成,CreateEmpAccount">员工培训账号生成</el-menu-item>
      <el-menu-item index="员工培训成绩录入,EmpTrainGradeInput">员工培训成绩录入</el-menu-item>
    </el-submenu>
    <el-submenu index="3">
      <template slot="title">
        <span>培训班级管理</span>
      </template>
      <el-menu-item index="班级管理,TrainClassManage">班级管理</el-menu-item>
      <el-menu-item index="新增培训班级,AddTrainClass">新增培训班级</el-menu-item>
      <el-menu-item index="班级统计,ClassPersonStatistics">班级统计</el-menu-item>
    </el-submenu>
    <el-submenu index="4">
      <template slot="title">
        <span>系统管理</span>
      </template>
      <el-menu-item index="公告发布,SysNoticeAdd">公告发布</el-menu-item>
      <el-menu-item index="管理员添加,SysManageAdd">管理员添加</el-menu-item>
    </el-submenu>
  </el-menu>
</template>

<script>
    export default {
        name: "EmpLeft",
      //导航栏
      methods: {
          //菜单子选项点击时触发的事件
          InsertStore(key){
            let strArr=key.split(",")
            //console.log("InsertStore.empleft",strArr[0], strArr[1]);
            this.$emit("parentHandle",strArr[0],strArr[1])
          },
          //测试事件监听
        handleOpen(key, keyPath) {
          console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
          console.log(key, keyPath);
        }
      }
    }
</script>

<style scoped>

</style>
